package com.ncsc.erp.model;
// Generated 20 มิ.ย. 2557, 12:55:43 by Hibernate Tools 3.4.0.CR1


import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * SdSaleOrder generated by hbm2java
 */
@Entity
@Table(name="sd_sale_order"
    ,catalog="ncsc_erp"
)
public class SdSaleOrder  implements java.io.Serializable {


     private long soNo;
     private SysTermOfPayment sysTermOfPayment;
     private SdSaleOrderStatus sdSaleOrderStatus;
     private SdCust sdCust;
     private SysTitleName sysTitleName;
     private SdCustType sdCustType;
     private SdQuotation sdQuotation;
     private String soCode;
     private String soDescr;
     private Date soDate;
     private String soRefCustPoNo;
     private String soCustCode;
     private String soCustFirstName;
     private String soCustMidName;
     private String soCustLastName;
     private String soCustIdCardNo;
     private String soTermOfPaymentDescr;
     private BigDecimal soDiscountPerc;
     private BigDecimal soDiscountVal;
     private BigDecimal soDiscountTotal;
     private short soStatusIncVat;
     private BigDecimal soVatPercVal;
     private BigDecimal soTotalPriceExcVat;
     private BigDecimal soTotalVat;
     private BigDecimal soTotalPrice;
     private Set<SdSaleOrderCustAddr> sdSaleOrderCustAddrs = new HashSet<SdSaleOrderCustAddr>(0);
     private Set<SdSaleOrderItem> sdSaleOrderItems = new HashSet<SdSaleOrderItem>(0);
     private Set<SdSaleOrderCustContact> sdSaleOrderCustContacts = new HashSet<SdSaleOrderCustContact>(0);

    public SdSaleOrder() {
    }

	
    public SdSaleOrder(long soNo, String soCode, String soDescr, Date soDate, BigDecimal soDiscountPerc, BigDecimal soDiscountVal, BigDecimal soDiscountTotal, short soStatusIncVat, BigDecimal soVatPercVal, BigDecimal soTotalPriceExcVat, BigDecimal soTotalVat, BigDecimal soTotalPrice) {
        this.soNo = soNo;
        this.soCode = soCode;
        this.soDescr = soDescr;
        this.soDate = soDate;
        this.soDiscountPerc = soDiscountPerc;
        this.soDiscountVal = soDiscountVal;
        this.soDiscountTotal = soDiscountTotal;
        this.soStatusIncVat = soStatusIncVat;
        this.soVatPercVal = soVatPercVal;
        this.soTotalPriceExcVat = soTotalPriceExcVat;
        this.soTotalVat = soTotalVat;
        this.soTotalPrice = soTotalPrice;
    }
    public SdSaleOrder(long soNo, SysTermOfPayment sysTermOfPayment, SdSaleOrderStatus sdSaleOrderStatus, SdCust sdCust, SysTitleName sysTitleName, SdCustType sdCustType, SdQuotation sdQuotation, String soCode, String soDescr, Date soDate, String soRefCustPoNo, String soCustCode, String soCustFirstName, String soCustMidName, String soCustLastName, String soCustIdCardNo, String soTermOfPaymentDescr, BigDecimal soDiscountPerc, BigDecimal soDiscountVal, BigDecimal soDiscountTotal, short soStatusIncVat, BigDecimal soVatPercVal, BigDecimal soTotalPriceExcVat, BigDecimal soTotalVat, BigDecimal soTotalPrice, Set<SdSaleOrderCustAddr> sdSaleOrderCustAddrs, Set<SdSaleOrderItem> sdSaleOrderItems, Set<SdSaleOrderCustContact> sdSaleOrderCustContacts) {
       this.soNo = soNo;
       this.sysTermOfPayment = sysTermOfPayment;
       this.sdSaleOrderStatus = sdSaleOrderStatus;
       this.sdCust = sdCust;
       this.sysTitleName = sysTitleName;
       this.sdCustType = sdCustType;
       this.sdQuotation = sdQuotation;
       this.soCode = soCode;
       this.soDescr = soDescr;
       this.soDate = soDate;
       this.soRefCustPoNo = soRefCustPoNo;
       this.soCustCode = soCustCode;
       this.soCustFirstName = soCustFirstName;
       this.soCustMidName = soCustMidName;
       this.soCustLastName = soCustLastName;
       this.soCustIdCardNo = soCustIdCardNo;
       this.soTermOfPaymentDescr = soTermOfPaymentDescr;
       this.soDiscountPerc = soDiscountPerc;
       this.soDiscountVal = soDiscountVal;
       this.soDiscountTotal = soDiscountTotal;
       this.soStatusIncVat = soStatusIncVat;
       this.soVatPercVal = soVatPercVal;
       this.soTotalPriceExcVat = soTotalPriceExcVat;
       this.soTotalVat = soTotalVat;
       this.soTotalPrice = soTotalPrice;
       this.sdSaleOrderCustAddrs = sdSaleOrderCustAddrs;
       this.sdSaleOrderItems = sdSaleOrderItems;
       this.sdSaleOrderCustContacts = sdSaleOrderCustContacts;
    }
   
     @Id 

    
    @Column(name="SO_NO", unique=true, nullable=false)
    public long getSoNo() {
        return this.soNo;
    }
    
    public void setSoNo(long soNo) {
        this.soNo = soNo;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="SO_TERM_OF_PAYMENT_NO")
    public SysTermOfPayment getSysTermOfPayment() {
        return this.sysTermOfPayment;
    }
    
    public void setSysTermOfPayment(SysTermOfPayment sysTermOfPayment) {
        this.sysTermOfPayment = sysTermOfPayment;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="SO_STATUS_NO")
    public SdSaleOrderStatus getSdSaleOrderStatus() {
        return this.sdSaleOrderStatus;
    }
    
    public void setSdSaleOrderStatus(SdSaleOrderStatus sdSaleOrderStatus) {
        this.sdSaleOrderStatus = sdSaleOrderStatus;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="SO_CUST_NO")
    public SdCust getSdCust() {
        return this.sdCust;
    }
    
    public void setSdCust(SdCust sdCust) {
        this.sdCust = sdCust;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="SO_CUST_TITLE_NO")
    public SysTitleName getSysTitleName() {
        return this.sysTitleName;
    }
    
    public void setSysTitleName(SysTitleName sysTitleName) {
        this.sysTitleName = sysTitleName;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="SO_CUST_TYPE_NO")
    public SdCustType getSdCustType() {
        return this.sdCustType;
    }
    
    public void setSdCustType(SdCustType sdCustType) {
        this.sdCustType = sdCustType;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="SO_QT_NO")
    public SdQuotation getSdQuotation() {
        return this.sdQuotation;
    }
    
    public void setSdQuotation(SdQuotation sdQuotation) {
        this.sdQuotation = sdQuotation;
    }

    
    @Column(name="SO_CODE", nullable=false, length=50)
    public String getSoCode() {
        return this.soCode;
    }
    
    public void setSoCode(String soCode) {
        this.soCode = soCode;
    }

    
    @Column(name="SO_DESCR", nullable=false, length=100)
    public String getSoDescr() {
        return this.soDescr;
    }
    
    public void setSoDescr(String soDescr) {
        this.soDescr = soDescr;
    }

    @Temporal(TemporalType.DATE)
    @Column(name="SO_DATE", nullable=false, length=10)
    public Date getSoDate() {
        return this.soDate;
    }
    
    public void setSoDate(Date soDate) {
        this.soDate = soDate;
    }

    
    @Column(name="SO_REF_CUST_PO_NO", length=30)
    public String getSoRefCustPoNo() {
        return this.soRefCustPoNo;
    }
    
    public void setSoRefCustPoNo(String soRefCustPoNo) {
        this.soRefCustPoNo = soRefCustPoNo;
    }

    
    @Column(name="SO_CUST_CODE", length=50)
    public String getSoCustCode() {
        return this.soCustCode;
    }
    
    public void setSoCustCode(String soCustCode) {
        this.soCustCode = soCustCode;
    }

    
    @Column(name="SO_CUST_FIRST_NAME", length=50)
    public String getSoCustFirstName() {
        return this.soCustFirstName;
    }
    
    public void setSoCustFirstName(String soCustFirstName) {
        this.soCustFirstName = soCustFirstName;
    }

    
    @Column(name="SO_CUST_MID_NAME", length=50)
    public String getSoCustMidName() {
        return this.soCustMidName;
    }
    
    public void setSoCustMidName(String soCustMidName) {
        this.soCustMidName = soCustMidName;
    }

    
    @Column(name="SO_CUST_LAST_NAME", length=50)
    public String getSoCustLastName() {
        return this.soCustLastName;
    }
    
    public void setSoCustLastName(String soCustLastName) {
        this.soCustLastName = soCustLastName;
    }

    
    @Column(name="SO_CUST_ID_CARD_NO", length=20)
    public String getSoCustIdCardNo() {
        return this.soCustIdCardNo;
    }
    
    public void setSoCustIdCardNo(String soCustIdCardNo) {
        this.soCustIdCardNo = soCustIdCardNo;
    }

    
    @Column(name="SO_TERM_OF_PAYMENT_DESCR", length=300)
    public String getSoTermOfPaymentDescr() {
        return this.soTermOfPaymentDescr;
    }
    
    public void setSoTermOfPaymentDescr(String soTermOfPaymentDescr) {
        this.soTermOfPaymentDescr = soTermOfPaymentDescr;
    }

    
    @Column(name="SO_DISCOUNT_PERC", nullable=false, precision=10)
    public BigDecimal getSoDiscountPerc() {
        return this.soDiscountPerc;
    }
    
    public void setSoDiscountPerc(BigDecimal soDiscountPerc) {
        this.soDiscountPerc = soDiscountPerc;
    }

    
    @Column(name="SO_DISCOUNT_VAL", nullable=false, precision=15)
    public BigDecimal getSoDiscountVal() {
        return this.soDiscountVal;
    }
    
    public void setSoDiscountVal(BigDecimal soDiscountVal) {
        this.soDiscountVal = soDiscountVal;
    }

    
    @Column(name="SO_DISCOUNT_TOTAL", nullable=false, precision=15)
    public BigDecimal getSoDiscountTotal() {
        return this.soDiscountTotal;
    }
    
    public void setSoDiscountTotal(BigDecimal soDiscountTotal) {
        this.soDiscountTotal = soDiscountTotal;
    }

    
    @Column(name="SO_STATUS_INC_VAT", nullable=false)
    public short getSoStatusIncVat() {
        return this.soStatusIncVat;
    }
    
    public void setSoStatusIncVat(short soStatusIncVat) {
        this.soStatusIncVat = soStatusIncVat;
    }

    
    @Column(name="SO_VAT_PERC_VAL", nullable=false, precision=10)
    public BigDecimal getSoVatPercVal() {
        return this.soVatPercVal;
    }
    
    public void setSoVatPercVal(BigDecimal soVatPercVal) {
        this.soVatPercVal = soVatPercVal;
    }

    
    @Column(name="SO_TOTAL_PRICE_EXC_VAT", nullable=false, precision=15)
    public BigDecimal getSoTotalPriceExcVat() {
        return this.soTotalPriceExcVat;
    }
    
    public void setSoTotalPriceExcVat(BigDecimal soTotalPriceExcVat) {
        this.soTotalPriceExcVat = soTotalPriceExcVat;
    }

    
    @Column(name="SO_TOTAL_VAT", nullable=false, precision=15)
    public BigDecimal getSoTotalVat() {
        return this.soTotalVat;
    }
    
    public void setSoTotalVat(BigDecimal soTotalVat) {
        this.soTotalVat = soTotalVat;
    }

    
    @Column(name="SO_TOTAL_PRICE", nullable=false, precision=15)
    public BigDecimal getSoTotalPrice() {
        return this.soTotalPrice;
    }
    
    public void setSoTotalPrice(BigDecimal soTotalPrice) {
        this.soTotalPrice = soTotalPrice;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="sdSaleOrder")
    public Set<SdSaleOrderCustAddr> getSdSaleOrderCustAddrs() {
        return this.sdSaleOrderCustAddrs;
    }
    
    public void setSdSaleOrderCustAddrs(Set<SdSaleOrderCustAddr> sdSaleOrderCustAddrs) {
        this.sdSaleOrderCustAddrs = sdSaleOrderCustAddrs;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="sdSaleOrder")
    public Set<SdSaleOrderItem> getSdSaleOrderItems() {
        return this.sdSaleOrderItems;
    }
    
    public void setSdSaleOrderItems(Set<SdSaleOrderItem> sdSaleOrderItems) {
        this.sdSaleOrderItems = sdSaleOrderItems;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="sdSaleOrder")
    public Set<SdSaleOrderCustContact> getSdSaleOrderCustContacts() {
        return this.sdSaleOrderCustContacts;
    }
    
    public void setSdSaleOrderCustContacts(Set<SdSaleOrderCustContact> sdSaleOrderCustContacts) {
        this.sdSaleOrderCustContacts = sdSaleOrderCustContacts;
    }




}


